USE [BVVD]
GO

/****** Object:  Table [dbo].[F_DIEMTHI]    Script Date: 5/31/2013 5:32:01 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[F_DIEMTHI](
	[RECID] [int] IDENTITY(1,1) NOT NULL,
	[NAMHOC] [varchar](50) FOREIGN KEY REFERENCES LST_DANHMUC(MADM) NOT NULL,
	[MALH] [varchar](15) FOREIGN KEY REFERENCES LST_LOPHOC(MALH) NOT NULL,
	[MAMH] [varchar](15) FOREIGN KEY REFERENCES LST_MONHOC(MAMH) NOT NULL,
	[MAHV] [varchar](15) FOREIGN KEY REFERENCES LST_HOCVIEN(MAHV) NOT NULL,	
	[NGAYTHI] [date] NULL,
	[LANTHI] [int] NULL,
	[DIEM] [numeric](4, 2) NULL,
	[TRANGTHAI] [varchar](15) NULL,
	[USER] [varchar](15) NOT NULL,
	[USER_DATE] [date] NULL,
	[GHICHU] [ntext] NULL,
PRIMARY KEY CLUSTERED 
(
	[RECID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[F_DIEMTHI] ADD  DEFAULT (CONVERT([date],getdate(),(101))) FOR [NGAYTHI]
GO

